// 引入font-awesome

/* import the fontawesome core */
import { library } from '@fortawesome/fontawesome-svg-core'
/* import font awesome icon component */
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
/* import all icons */
import { fas } from '@fortawesome/free-solid-svg-icons'

/* add icons to the library */
library.add(fas)

// 引入样式文件
import './styles/index.scss'

// 引入自定义组件
import Icon from './components/Icon'
import Button from './components/Button'
import Card from './components/Card'
import Dialog from './components/Dialog'
import Pager from './components/Pager'
import Collapse from './components/Collapse'
import CollapseItem from './components/Collapse'
import Tooltip from './components/Tooltip'
import Dropdown from './components/Dropdown'

const componentArr = [Icon, Button, Card, Dialog, Pager, Collapse, CollapseItem, Tooltip, Dropdown]

// 注册自定义组件
const install = (app) => {
  componentArr.forEach((component) => {
    app.component(component.name, component)
  })
  // 注册font-awesome-icon组件
  app.component('font-awesome-icon', FontAwesomeIcon)
}

// 按需导出
export { install, Icon, Button, Card, Dialog, Pager, Collapse, CollapseItem, Tooltip, Dropdown }

// 全部导出
export default {
  install,
}
